package com.chixing.day16.IODemo;

import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class WriterDemo {
    public static void main(String[] args) {
        //创建字符写入流对象
        Writer w = null;
        try {
            w = new FileWriter("//Users//jasonmarslyon//CX_Workspace//Java_Workspace//Test//hello.txt", true);
        } catch (IOException e) {
            e.printStackTrace();
        }
        //写入数据
        try {
            w.write("This is Jason Marslyon Speaking !!");
            w.flush();  //刷新缓冲区到目标文件
        } catch (IOException e) {
            e.printStackTrace();
        }

  /*      //关闭流
        try {
            w.close();
        } catch (IOException e) {
           e.printStackTrace();
        }*/
    }
}
